package com.power.algorithm.sort;

import java.util.Random;

/**
 * @description:
 * @author: jiangnan
 * @time: 2021/5/21 3:43 下午
 * 生成一个100个单位的随机数
 * 生成一个5单位的随机数
 */

public class Tools {


    public static int[] origin5Array;
    public static int[] origin100Array;

    public static int[] testArray = new int[]{2, 1, 5, 3, 4};
    public static int[] testArray2 = new int[]{1, 2, 3, 4, 5};
    public static int[] testArray3 = new int[]{5, 4, 3, 2, 1};


    public static int[] createOrigin5Array() {
        origin5Array = new int[5];
        for (int i = 0; i < 5; i++) {
            origin5Array[i] = new Random().nextInt(10000);
        }
        return origin5Array;
    }
    public static int[] createOrigin10Array() {
        origin5Array = new int[10];
        for (int i = 0; i < 10; i++) {
            origin5Array[i] = new Random().nextInt(30);
        }
        return origin5Array;
    }
    public static int[] createOrigin100Array() {
        origin100Array = new int[100];
        for (int i = 0; i < 100; i++) {
            origin100Array[i] = new Random().nextInt(10000);
        }
        return origin100Array;
    }


    public static void display(int[] array) {
        System.out.println();
        //System.out.println();
        System.out.print("排序好的元素:: ");
        for (int obj : array) {
            System.out.print(obj + ", ");
        }
        System.out.println();
        // System.out.println();
    }

    public static void main(String[] args) {
        Tools.createOrigin5Array();
        Tools.createOrigin100Array();
        Tools.display(origin5Array);
        System.out.println("");
        Tools.display(origin100Array);

    }
}
